"use client"

import * as React from "react"
import {
  IconActivity,
  IconCamera,
  IconChartBar,
  IconDashboard,
  IconDatabase,
  IconFileAi,
  IconFileDescription,
  IconFileWord,
  IconFolder,
  IconHelp,
  IconInnerShadowTop,
  IconListDetails,
  IconReport,
  IconSearch,
  IconSettings,
  IconUsers,
  Icon3dCubeSphere,
  IconBuildingHospital,
  IconMapPin,
  IconCalendar,
  IconPhoto,
} from "@tabler/icons-react"

import { NavDocuments } from "@/components/nav-documents"
import { NavMain } from "@/components/nav-main"
import { NavSecondary } from "@/components/nav-secondary"
import { NavUser } from "@/components/nav-user"
import {
  Sidebar,
  SidebarContent,
  SidebarFooter,
  SidebarHeader,
  SidebarMenu,
  SidebarMenuButton,
  SidebarMenuItem,
} from "@/components/ui/sidebar"

const data = {
  user: {
    name: "医疗数字孪生",
    email: "admin@hospital.com", 
    avatar: "/avatars/medical-admin.jpg",
  },
  navMain: [
    {
      title: "仪表板",
      url: "/dashboard",
      icon: IconDashboard,
    },
    {
      title: "实时监控",
      url: "/monitoring",
      icon: IconActivity,
    },
    {
      title: "数据分析",
      url: "/analytics",
      icon: IconChartBar,
    },
    {
      title: "项目管理",
      url: "/projects",
      icon: IconFolder,
    },
    {
      title: "团队协作",
      url: "/team", 
      icon: IconUsers,
    },
    {
      title: "3D建模",
      url: "/floor-processing",
      icon: Icon3dCubeSphere,
    },
          {
        title: "智能建模",
        url: "/intelligent-modeling",
        icon: IconInnerShadowTop,
      },
          {
      title: "统一建模",
      url: "/unified-modeling",
      icon: IconInnerShadowTop,
    },
    {
      title: "医院管理",
      url: "/hospital-management",
      icon: IconBuildingHospital,
    },
    {
      title: "景点管理",
      url: "/attraction-management",
      icon: IconMapPin,
    },
    {
      title: "预约管理", 
      url: "/appointment-management",
      icon: IconCalendar,
    },
    {
      title: "轮播图管理",
      url: "/banner-management",
      icon: IconPhoto,
    },
  ],
  navClouds: [
    {
      title: "数据库",
      icon: IconDatabase,
      isActive: true,
      url: "/database",
      items: [
        {
          title: "数据表",
          url: "/database/tables",
        },
        {
          title: "报告",
          url: "/database/reports",
        },
        {
          title: "备份",
          url: "/database/backup",
        },
      ],
    },
    {
      title: "文档助手",
      icon: IconFileAi,
      url: "/assistant",
      items: [
        {
          title: "智能写作",
          url: "/assistant/writing",
        },
        {
          title: "文档审核",
          url: "/assistant/review",
        },
        {
          title: "模板库",
          url: "/assistant/templates",
        },
      ],
    },
    {
      title: "Prompts",
      icon: IconFileAi,
      url: "#",
      items: [
        {
          title: "Active Proposals",
          url: "#",
        },
        {
          title: "Archived",
          url: "#",
        },
      ],
    },
  ],
  navSecondary: [
    {
      title: "Settings",
      url: "#",
      icon: IconSettings,
    },
    {
      title: "Get Help",
      url: "#",
      icon: IconHelp,
    },
    {
      title: "Search",
      url: "#",
      icon: IconSearch,
    },
  ],
  documents: [
    {
      name: "Data Library",
      url: "#",
      icon: IconDatabase,
    },
    {
      name: "Reports",
      url: "#",
      icon: IconReport,
    },
    {
      name: "Word Assistant",
      url: "#",
      icon: IconFileWord,
    },
  ],
}

export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
  return (
    <Sidebar collapsible="offcanvas" {...props}>
      <SidebarHeader>
        <SidebarMenu>
          <SidebarMenuItem>
            <SidebarMenuButton
              asChild
              className="data-[slot=sidebar-menu-button]:!p-1.5"
            >
              <a href="#">
                <IconInnerShadowTop className="!size-5" />
                <span className="text-base font-semibold">Acme Inc.</span>
              </a>
            </SidebarMenuButton>
          </SidebarMenuItem>
        </SidebarMenu>
      </SidebarHeader>
      <SidebarContent>
        <NavMain items={data.navMain} />
        <NavDocuments items={data.documents} />
        <NavSecondary items={data.navSecondary} className="mt-auto" />
      </SidebarContent>
      <SidebarFooter>
        <NavUser user={data.user} />
      </SidebarFooter>
    </Sidebar>
  )
}
